package com.lc.pianostudent.conn;


import com.lc.pianostudent.bean.ContactBean;
import com.lc.pianostudent.bean.ContactListBean;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/2/22.
 */
@HttpInlet(Conn.USER_MYLEVEL)
public class PostUserMyLevel extends BaseAsyPost {

    public String user_id;
    public PostUserMyLevel(AsyCallBack asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected PostUserMyLevelInfo parser(JSONObject object) throws Exception {
        if (object.optString("code").equals("200")) {

            PostUserMyLevelInfo info = new PostUserMyLevelInfo();

            info.code = object.optString("code");
            info.grade = object.optString("grade");
            info.now = object.optString("now");
            info.need = object.optString("need");
            info.next = object.optString("next");

            TOAST = object.optString("message");
            return info;

        } else {

            TOAST = object.optString("message");

        }

        return null;
    }

    public static class PostUserMyLevelInfo {

        public String code, grade,now,need,next;

        public List<ContactBean> contactList = new ArrayList<>();

    }

}
